package com.example.shop.domain;

import com.example.shop.bos.Bostype;
import com.example.shop.bos.Entry;
import lombok.Data;

import javax.persistence.*;

@Entity
@Bostype("A03")
@Table(name = "T_ORDERITEM")
@Data
public class OrderItem extends Entry {

    private Integer count;

    @ManyToOne(fetch = FetchType.LAZY)
    @Access(AccessType.PROPERTY)
    public Order getParent() {
        return (Order)super.getInnerParent();
    }

    @ManyToOne(fetch = FetchType.LAZY)
    private Product product;

}
